#include <iostream>
using namespace std;

/*
    【题目213】定义一个车基类Vehicle，含私有成员speed、weight。派生出自行车类Bicycle，
    增加high成员：汽车类Car，增加seatnum成员。从Bicycle和Car中派生出摩托车类Motocycle。
*/

class Vehicle
{
public:
    Vehicle(int s, int w) : speed(s), weight(w)
    {
        cout << "Vehicle()" << endl;
    }

private:
    int speed;
    int weight;
};

class Bicycle : public Vehicle
{
public:
    Bicycle(int h, int s, int w) : Vehicle(s, w), high(h)
    {
        cout << "Bicycle()" << endl;
    }

private:
    int high;
};

class Car : public Vehicle
{
public:
    Car(int s, int w, int sn) : Vehicle(s, w), seatnum(sn)
    {
        cout << "Car()" << endl;
    }

private:
    int seatnum;
};

class Motocycle : public Bicycle, public Car
{
public:
    Motocycle(int s, int w, int h, int sn) : Bicycle(h, s, w), Car(s, w, sn)
    {
        cout << "Motocycle()" << endl;
    }
};

int main()
{
    Motocycle m(100, 200, 300, 4);
    return 0;
}